package gestion.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;

import gestion.conexion.ConexionBD;


public class InvitadoDAO extends BaseDAO {

	
	public void invitarUsuario(int idea, int persona){
		Connection conn = null ;
		PreparedStatement pstm = null;
		
		String query = "insert into invitado (idea_ididea, persona_idpersona) values " +
				"(?,?)";
		
		try {
		conn = ConexionBD.obtenerConexion();
		pstm = conn.prepareStatement(query);
		pstm.setInt(1, idea);
		pstm.setInt(2, persona);
		
		pstm.executeUpdate();
			
			
		} catch (Exception e) {
			System.out.println(e.getMessage());
		} finally{
		
		cerrarConexion(conn);	
		cerrarStatement(pstm);
		
			
		}
		
		
		
	}
	
	
}
